package com.example.demo.java8.Optional.stream;

import java.util.Optional;

public class OptainalExample {
    public static void main(String[] args) {
        Optional<String> fullName = Optional.ofNullable(null);
        Optional<Object> empty = Optional.empty();
        System.out.println(fullName.isPresent());
        System.out.println(empty.orElse("abc"));
        System.out.println(empty.orElseGet(()->"123"));
    }
}
